/*
 * Project : Linuxbox
 * File    : UserManAdd.java
 * Version : 1.0
 * Author  : Kevin Zhang
 *
 * Copyright (c) 2000-2001 by Linuxbox, Inc.
 * All rights reserved.
 */
package linuxbox.status.servlet;

import javax.servlet.http.*;

import java.sql.*;

import linuxbox.BoxStatic;
import linuxbox.common.*;
import linuxbox.status.logic.*;

public class StatusCheckOutAction extends Action {
	protected static final String ID_PARAM = "ID";         
	protected static String successJSP = null;
	
    public void doAction(HttpSession aSession, BoxSession aBoxSession, 
    HttpServletRequest req, HttpServletResponse res) throws Exception {
		BoxStatic.logger.debug("I am in StatusCheckOutAction now ... ");
		String userID = req.getParameter(ID_PARAM);
		BoxStatic.logger.debug("id is " + userID);
		StatusManager sm = StatusManager.getInstance();
		sm.setCheckOut(Integer.parseInt(userID), new Timestamp(System.currentTimeMillis()));
		
		redirectFile(successJSP, req, res);
	}

	public void setSuccessJSP(String str) {
		successJSP = str;
	}
}
